<!DOCTYPE html>
<html>
    <head>
        <title><?= $title ?></title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        
        
        <?= local_bootstrap3_css(); ?>
        
        <link href="<?= url_systemfile().'/css/manage_layout.css' ?>" rel="stylesheet">
        <?php
            if (isset($cssfiles)) {
                foreach ($cssfiles as $cssfile) {
                    echo '<link href="'.url_systemfile().'/css/'.$cssfile.'" rel="stylesheet">';
                }
            }
        ?>
        
    </head>
    <body>
        <header class="navbar navbar-fixed-top navbar-inverse" role="banner">
            <div class="container">
                <div class="navbar-header">
                    <a href="#" class="navbar-brand">Shopgoox</a>
                </div>
                <nav class="collapse navbar-collapse" role="navigation">
                    <ul class="nav navbar-nav">
                        <li><a href="#">Link1</a></li>
                        <li class="active"><a href="#">Link2</a></li>
                        <li><a href="#">Link3</a></li>
                    </ul>
                </nav>
            </div>
        </header>
        
        <div class="header">
            <h4><?= $header ?></h4>
        </div>
        
        <div class="main-section">
            <div class="col-md-3 fixed menu-sidebar">
                <ul class="nav nav-list admin-sidenav">
                    <li id='orders'>
                        <a href="#">
                            <i class="glyphicon-chevron-right glyphicon"></i>
                            Quản Lý Đơn Hàng
                        </a>
                    </li>
                    <li id='catalogs'>
                        <a href="#">
                             <i class="glyphicon-chevron-right glyphicon"></i>
                             Quản Lý Catalog
                        </a>
                    </li>
                    <li id='products'>
                        <?= anchor('manage_products/manage_listproducts/index', 
                              '<i class="glyphicon-chevron-right glyphicon"></i>Quản Lý Sản Phẩm') ?>
                    </li>
                    <li id='guide'>
                        <?= anchor('manage_layouts/guide', 
                              '<i class="glyphicon-chevron-right glyphicon"></i>Hướng Dẫn Sử Dụng Layout') ?>
                    </li>
                </ul>
            </div>
            
            <div class="content row">
                <?php
                     $this->load->view($module.'/'.$view_file);
                ?>
            </div>
        </div>
        
        <footer>
            Shopgoox.com <br />
            Designed By SMT Team <br />
        </footer>
    </body>
</html>

<?= local_jQuery(); ?>
<?= local_bootstrap3_js(); ?>

<?php    
    if (isset($jsfiles)) {
        foreach ($jsfiles as $jsfile) {
            echo '<script src="'.url_systemfile().'/js/'.$jsfile.'"></script>';
        }
    }
?>

<script>
    $(document).ready(function() {
        var module = "<?= $module ?>";
        
        switch (module) {
            case 'manage_layouts':
                $("#guide").addClass("active");
                break;
            case 'manage_catalogs':
                $("#catalogs").addClass("active");
                break;
            case 'manage_products':
                $("#products").addClass("active");
                break;
            default:
                $("#orders").addClass("active");
                break;
        }
    });
</script>